﻿using System;
using System.Net;
using System.Windows; 
using SuperLauncher.Helpers;
using System.ComponentModel.DataAnnotations;
using SL8.SL.ViewModels;
using SL8.SL;

namespace SuperLauncher.Entitys
{
    public class CategoryInfo :  ViewModelBase
    {
        private System.Collections.ObjectModel.ObservableCollection<ItemInfo> _items;

        [Required(ErrorMessage = "类别名称不能为空")]
        public string Title
        {
            get
            {
                return (string)this.GetCacheValue(o => o.Title, string.Empty);
            }

            set
            {
                this.SetCacheValueAndValidate(o => o.Title, value);
            }
        }

        public System.Collections.ObjectModel.ObservableCollection<ItemInfo> Items
        {
            get
            {
                if (this._items == null)
                {
                    this._items = new System.Collections.ObjectModel.ObservableCollection<ItemInfo>();
                }

                return this._items;
            }
        }
    }
}
